package Testing;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;

import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

public class Links {

	public static void main(String args[]) throws Throwable{
		
		Links lk =new Links();
		HashMap<String,String> hm = lk.links();
		System.out.println(hm.get("//img[@alt='asc order']").split(";")[1]);
		
	}
	
	
	public HashMap<String,String> links() throws BiffException, Exception
	{
		HashMap<String, String > hm = new HashMap<String , String>();
		
		String xlFilePath= "C:\\Users\\mkasim\\Desktop\\Links.xls";
		String sheetName= "Sheet1";
		
		Workbook workbook = Workbook.getWorkbook(new File(xlFilePath));
		Sheet sheet = workbook.getSheet(sheetName);
		/*System.out.println("sheet.getRows()"+sheet.getRows());
		System.out.println("sheet.getColumns()"+sheet.getColumns());
		*/for(int i=0;i<sheet.getRows();i++)
		{
			/*for (int j = 0; j < sheet.getColumns(); j++)
			 {
				System.out.println("contents of "+i+j+sheet.getCell(j, i).getContents());
			 }
			*/
			/*hm.put(sheet.getCell(0, i).getContents(),sheet.getCell(1, i).getContents());*/
			
			/****** concatenated the wait time with the cell contents *******/
			
/*			System.out.println("Linksssssss before hashmap"+ sheet.getCell(1, i).getContents()+";"+sheet.getCell(2, i).getContents());
*/			hm.put(sheet.getCell(0, i).getContents(),sheet.getCell(1, i).getContents()+";"+sheet.getCell(2, i).getContents());
/*			System.out.println("Linksssssss after hashmap" +sheet.getCell(0, i).getContents()+"="+ hm.get(sheet.getCell(0, i).getContents()));
*/		}
		return hm;
	}
}